<script>
/*
 * 图表配置编辑器组件
 */
import RenderMapConfig from './map/RenderMapConfig';
import HeatMapConfig from './map/HeatMapConfig';
import ScatterMapConfig from './map/ScatterMapConfig';

export default {
  name: 'MapConfig',
  components: {
    RenderMapConfig,
    HeatMapConfig,
    ScatterMapConfig,
  },
  props: {
    //专题图类型
    chartType: {
      type: String,
      default: '',
    },
    subjectId: {
      type: String,
      default: '',
    },
  },
  data() {
    return {
      subjectType: '',
    };
  },
  watch: {
    chartType(newVal) {
      this.subjectType = newVal + 'Config';
    },
  },
  created() {},
  methods: {},
};
</script>

<template>
  <div class="config-wrapper">
    <component
      :is="subjectType"
      :subject-id="subjectId"></component>
  </div>
</template>

<style lang="less">
.config-wrapper {
  margin: 10px;
  height: auto;
}
</style>
